from os import listdir,chdir

tests = [file for file in listdir('tests') if file[-3:] == '.py']
failed = [] 
chdir("tests")
for name in tests:
    basename = name[:-3]
    print "RUNNING "+basename
    try:
        execfile(name)
    except:
        failed.append(basename)
        print "**FAILED**"
chdir("..")
print "TESTS RESULTS:"
print "Failure : %d out of %d" % (len(failed),len(tests))

